class getFileSize {
	constructor(){}
	getfilesize(param){
		const units = ['B', 'KB', 'MB', 'GB', 'TB'];
		let unitIndex = 0;
		while(param >= 1024 && unitIndex < units.length - 1){
			param = param / 1024;
			unitIndex++;
		}
		param = param.toFixed(2);
		return `${param} ${units[unitIndex]}`;
	}
}
module.exports = { getFileSize }